package com.leyou.gateway.web;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/*TODO
   定义一个controller用于编写失败的逻辑代码
   */
@RestController
public class FallbackController {
    //todo 设置处理默认超时的超时处理逻辑  --return
    @GetMapping("/hystrix/fallback")
    //ResponseEntity:用来封装返回的HttpResponse数据
    public ResponseEntity<String>fallBackController(){
        return  ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body("请求超时");
    }
}
